Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 39ed5fdd316423c6b33ffe6beed1a44779ef645e


Parents : bd0eef6
Author : Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-05-27T12:07:56-05:00

chore(dependencies): update @electron/get to version 3.1.0 and adjust patching logic in electron-builder file system script

Changes

3 files changed, 42 insertions(+), 9 deletions(-)


Diff

diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1ea7a02c..6b5093e4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6782,7 +6782,7 @@ snapshots:
'@develar/schema-utils': 2.6.5
'@electron/asar': 3.4.1
'@electron/fuses': 1.8.0
- '@electron/get': 3.0.0
+ '@electron/get': 3.1.0
'@electron/notarize': 2.5.0
'@electron/osx-sign': 1.3.3
'@electron/rebuild': 4.0.3

diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 89a58379..c3ae1dfa 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -15,6 +15,7 @@ allowBuilds:
esbuild: true
overrides:
+ "@electron/get": "3.1.0"
dompurify: ">=3.4.5"
lodash: ">=4.17.23"
"@isaacs/brace-expansion": ">=5.0.1"

diff --git a/scripts/patch-electron-builder-fs.cjs b/scripts/patch-electron-builder-fs.cjs
index 230fd0fe..ddd0ae48 100644
--- a/scripts/patch-electron-builder-fs.cjs
+++ b/scripts/patch-electron-builder-fs.cjs
@@ -24,16 +24,48 @@ const preamble = `const __ebFsConstants = (() => {
`;
+const cacheModeFallback = {
+ ReadWrite: 0,
+ ReadOnly: 1,
+ WriteOnly: 2,
+ Bypass: 3,
+};
+
function patchBinDownload(source) {
- if (source.includes("__ebFsConstants")) {
- return source;
+ let next = source;
+ let changed = false;
+
+ if (!next.includes("__ebFsConstants")) {
+ next = preamble + next;
+ next = next.replace(/fs_1\.constants\.R_OK/g, "__ebFsConstants.R_OK");
+ next = next.replace(/fs_1\.constants\.W_OK/g, "__ebFsConstants.W_OK");
+ next = next.replace(/fs\.constants\.R_OK/g, "__ebFsConstants.R_OK");
+ next = next.replace(/fs\.constants\.W_OK/g, "__ebFsConstants.W_OK");
+ changed = true;
}
- let next = preamble + source;
- next = next.replace(/fs_1\.constants\.R_OK/g, "__ebFsConstants.R_OK");
- next = next.replace(/fs_1\.constants\.W_OK/g, "__ebFsConstants.W_OK");
- next = next.replace(/fs\.constants\.R_OK/g, "__ebFsConstants.R_OK");
- next = next.replace(/fs\.constants\.W_OK/g, "__ebFsConstants.W_OK");
- return next;
+
+ if (!next.includes("__ebElectronDownloadCacheMode")) {
+ const injectAfterGetRequire =
+ /(const get_1 = require\("@electron\/get"\);)/;
+ if (injectAfterGetRequire.test(next)) {
+ next = next.replace(
+ injectAfterGetRequire,
+ `$1
+const __ebElectronDownloadCacheMode = get_1.ElectronDownloadCacheMode ?? ${JSON.stringify(cacheModeFallback)};`,
+ );
+ next = next.replace(
+ /get_1\.ElectronDownloadCacheMode\.ReadWrite/g,
+ "__ebElectronDownloadCacheMode.ReadWrite",
+ );
+ next = next.replace(
+ /in get_1\.ElectronDownloadCacheMode/g,
+ "in __ebElectronDownloadCacheMode",
+ );
+ changed = true;
+ }
+ }
+
+ return changed ? next : source;
}
for (const target of targets) {


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────